<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const obj = {
      id: 1,
      key: 2,
      aa: [{
        c: 3,
        d: "vv",
        // [[Symbol('d')]]:1,
        cc: [{
          'b': 3,
          'g': "22"
        }]
      }, {
        b: 3,
        c: "vv",
        dd: {
          'b': 3,
          'g': "22"
        }
      }]
    };
    function mmm(obj) {
      var sum = 0;
      function xxx(obj) {
        // console.log(typeof(obj));
        if (typeof (obj) === 'number') {
          sum = obj + sum
        } else if (typeof (obj) === 'object') {
          for (const key in obj) {
            console.log(obj[key]);
            xxx(obj[key])
          }
        }
      }
      xxx(obj)
      console.log(sum);
    }

    mmm(obj)
  </script>
</body>

</html>